package com.edu.zut.hb.software.server.service.impl;

import com.edu.zut.hb.software.server.service.CountService;
import com.edu.zut.hb.software.server.service.IAdminService;
import com.edu.zut.hb.software.server.service.IStudentService;
import com.edu.zut.hb.software.server.service.ITeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class CountServiceImpl implements CountService {
    @Autowired
    IAdminService iAdminService;
    @Autowired
    IStudentService iStudentService;
    @Autowired
    ITeacherService iTeacherService;

    @Override
    public Map<String, Integer> countRole() {
        Map<String, Integer> result = new HashMap<>();
        result.put("Admin", iAdminService.count());
        result.put("Student", iStudentService.count());
        result.put("Teacher", iTeacherService.count());
        return result;
    }
}
